<?php


namespace FoxLib\Middleware;


use Closure;
use Illuminate\Http\Request;

class ActionRecordMiddleware
{
    public function handle(Request $request, Closure $next)
    {
        $requestUserId = $request->header("X-Authenticated-Userid");
        $actionInfo = [
            'userId' => $requestUserId,
            'path' => $request->getPathInfo(),
            'method' => $request->getMethod(),
            'params' => $request->input()
        ];
        app('log')->info($actionInfo);
        return $next($request);
    }
}
